Page({

  /**
   * 页面的初始数据
   */
  data: {
    schema:[
    ],
    zh: '',
    title:'',
    remark: '',
    webUrl: '',
    formData:{
    },
    result: '',
  },
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: options.title,
    })

    this.setData({
      apiType: options.zh,
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e) {
  },
  choose1() {  
    const audioCtx = wx.createWebAudioContext()
    // 定义音频时长为2秒
    const duration = 2;
    // 计算帧数量：时长 × 采样率
    const frameCount = duration * audioCtx.sampleRate;
    const myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate);
    console.log(myArrayBuffer)
    const nowBuffering = myArrayBuffer.getChannelData(0);
    this.setData({
      result: nowBuffering
    })
  },
})